package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.DiaoboItemKJDTO;
import com.neusoft.neuiotms.dcam.workflow.model.DiaoboItemKJ;

@Component
public class DiaoboItemKJConverter extends AbstractConverter<DiaoboItemKJ, DiaoboItemKJDTO> {

    @Override
    public DiaoboItemKJ toModel(final DiaoboItemKJDTO dto) {

        final DiaoboItemKJ model = new DiaoboItemKJ();

        model.setName(dto.getName());
        model.setCode(dto.getCode());
        model.setSpecifications(dto.getSpecifications());
        model.setSerialnumber(dto.getSerialnumber());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setManagementUserCode(dto.getManagementUserCode());
        model.setManagementUserName(dto.getManagementUserName());
        model.setManagementOrgCode(dto.getManagementOrgCode());
        model.setManagementOrgName(dto.getManagementOrgName());
        model.setStatus(dto.getStatus());
        model.setDiaoboLocation(dto.getDiaoboLocation());
        model.setDiaoboLocationName(dto.getDiaoboLocationName());
        model.setDiaoboUserCode(dto.getDiaoboUserCode());
        model.setDiaoboUserName(dto.getDiaoboUserName());
        model.setLocationName(dto.getLocationName());
        return model;
    }

    @Override
    public DiaoboItemKJDTO toDTO(final DiaoboItemKJ model, final boolean forListView) {
        final DiaoboItemKJDTO dto = new DiaoboItemKJDTO();
        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setCode(model.getCode());
        dto.setSpecifications(model.getSpecifications());
        dto.setSerialnumber(model.getSerialnumber());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setManagementUserCode(model.getManagementUserCode());
        dto.setManagementUserName(model.getManagementUserName());
        dto.setManagementOrgCode(model.getManagementOrgCode());
        dto.setManagementOrgName(model.getManagementOrgName());
        dto.setStatus(model.getStatus());
        dto.setDiaoboLocation(model.getDiaoboLocation());
        dto.setDiaoboLocationName(model.getDiaoboLocationName());
        dto.setDiaoboUserCode(model.getDiaoboUserCode());
        dto.setDiaoboUserName(model.getDiaoboUserName());
        dto.setLocationName(model.getLocationName());
        return dto;
    }

}
